final Toast toast = Toast.makeText(getApplicationContext(), "My message", Toast.LENGTH_SHORT); toast.show(); toast.setGravity(Gravity.CENTER, 0, 0); new CountDownTimer(2000, 2000) { @Override public void onTick(long millisUntilFinished) { toast.show(); } @Override public void onFinish() { toast.cancel(); } }.start();
Liked By
Write Answer
How to short time of Toast notification
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy
Join MindStick Community
You have need login or register for voting of answers or question.
Manoj Pandey
05-Mar-2015Use following code instead of your code